<% unless @width.empty? %>
<style>
.ajax-scaffold-<%= params[:scaffold_id] %> {
width: <%= @width %>;
}
</style>
<% end %>

<% if @show_wrapper %>
<div id="<%= params[:scaffold_id] %>" class="ajax-scaffold ajax-scaffold-<%= params[:scaffold_id] %>">
  <div id="<%= scaffold_content_id(params) %>">
<% end %>
    <div class="ajax-scaffold-header">
	  <% unless @no_create %>
        <div class="actions">
          <% new_params = params.merge(:controller => @scaffold_controller, :action => "new"+@suffix) %>
          <%= loading_indicator_tag(new_params) %>
          <%= link_to_remote "Adicionar",
            { :url => new_params,
              :loading => "Element.show('#{loading_indicator_id(new_params)}');" },
            { :href => url_for(new_params), :class => "create" } %>
        </div>
      <% end %>
    <h2>Contas</h2>
  </div>
  <table cellpadding="0" cellspacing="0">
  <thead>
    <tr>
      <%= render :partial => scaffold_partial_path('column_headings') %>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td colspan="<%= num_columns %>" class="messages-container">
        <div id="<%= scaffold_messages_id(params) %>">
          <%= render :partial => scaffold_partial_path('messages') %>
        </div>
        <p id="<%= empty_message_id(params) %>" class="empty-message" <%= " style=\"display:none;\" " if !@collection.empty? %>>
          Sem registros
        </p>
      </td>
    </tr>
  </tbody>
  <tbody id="<%= scaffold_tbody_id(params) %>">
    <% if !@collection.empty? %>
  	  <%= render :partial => scaffold_partial_path('row'), :collection => @collection, :locals => { :hidden => false } %>
	  <% if show_column_totals? %>
  	  	<%= render :partial => scaffold_partial_path('column_totals') %>
	  <% end %>
    <% end %>
  </tbody>
</table>
<div class="ajax-scaffold-footer">
  <%= render :partial => scaffold_partial_path('pagination_links'), :locals => { :paginator => @paginator } %>
</div>
<% if @show_wrapper %>
</div>
</div>

<script type="text/javascript">
Rico.Corner.round('<%= params[:scaffold_id] %>', {color: '#005CB8', bgColor: '#fff', compact: true});
</script>
<% end %>